Repository navigation
Stop exporting tools as a public package deps - #90
Conversation
MSBuild is supplied by the host, and these packages already ship the assemblies they need under tools/, so the dependency only pushed MSBuild's own transitive graph onto consumers. A net48 consumer of SIL.ReleaseTasks 3.3.0 pulled 24 packages against 6 for 3.1.1. Marking it PrivateAssets="All" drops it from the nuspec and restores the 3.1.1 dependency surface with the tools/ payload unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tombogle
left a comment
There was a problem hiding this comment.
I'm approving, but I do think that doing the same for SIL.Core (either as part of this PR or separately) is the thing to do. Good work thinking through the right fix.
@tombogle reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on imnasnainaec).
Same reasoning as Microsoft.Build.Tasks.Core: SIL.Core.dll already ships under tools/ next to the task assembly, so the public dependency only pushed its subtree onto consumers. A net472 consumer of SIL.BuildTasks 3.3.0 pulled 26 packages; with this it pulls 6, and Newtonsoft.Json 11.0.1 (GHSA-5crp-9r3c-p9vr) drops out of the consumer graph entirely. SIL.BuildTasks.Tests was getting SIL.Core 9.0.0 transitively through the project reference. Without it, SIL.TestUtilities 7.0.0's older SIL.Core 7.0.0 wins and the tests fail to load SIL.BuildTasks with a FileLoadException, so pin 9.0.0 explicitly in the test project. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Done — It needed one extra change. Consumer graph, measured by restoring a net472 project against the packed output with an isolated package cache:
Tests are back to the master baseline: 39/39 in SIL.ReleaseTasks.Tests, 176 pass / 6 fail in SIL.BuildTasks.Tests. Those 6 are pre-existing and fail identically on master — Two things I did not touch, since they widen the scope — say the word if you want either here:
|
|
Let's not stop halfway! I agree that This is a build-task package whose purpose is specifically to carry its own tooling, so let's make the dependency graph empty, accept the need for explicit test dependencies, and verify that those explicit references stay in the test projects. That's a small and healthy price for not exporting an irrelevant—and potentially vulnerable—dependency graph. |
…ssets Each package's only job is to carry its own build-time tooling under tools/, so SuppressDependenciesWhenPacking expresses "exports nothing" once per project instead of PrivateAssets="All" on every reference. This also catches Markdig.Signed and Microsoft.Win32.Registry, which were still public, with the tools/ payloads unchanged. NU5128 is suppressed: pack now omits the dependencies group entirely rather than emitting it empty per-TFM, which nuget's lib/dependency-group consistency check otherwise flags. Removing PrivateAssets from SIL.BuildTasks's own PackageReferences restores transitive flow through the ProjectReference into SIL.BuildTasks.Tests (SuppressDependenciesWhenPacking only affects the packed nuspec), so the explicit SIL.Core pin there stays load-bearing; reworded its comment to say why. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3b5e94f to
f3f45d1
Compare
|
We probably don't need to document the exact versions in the comment. Could just say; "Referencing an older version of SIL.TestUtilities otherwise pulls an older version of SIL.Core. |
…inst SIL.TestUtilities is version-locked to SIL.Core (7.0.0 -> 7.0.0, 9.0.0 -> 9.0.0), so holding it at 7.0.0 while SIL.BuildTasks builds against SIL.Core 9.0.0 left the test project running a cross-major mix that the explicit SIL.Core reference was suppressing an MSB3277 conflict warning for. Bumping to 9.0.0 aligns all four SIL packages; SIL.WritingSystems moves 7.0.0 -> 9.0.0 with it and nothing new enters the graph. Deliberately not going to the current 17.0.0: that would drag SIL.Core to 17.0.0, which is what #88 reverted over the Mono.Unix restore breakage. The SIL.Core reference stays, because FileUpdateTests uses SIL.Providers directly. Its comment is removed: the version claim it made is obsolete after the bump, and it named SuppressDependenciesWhenPacking as the reason transitive flow was unavailable, which was never right for a ProjectReference -- that property only rewrites the packed nuspec. Tests unchanged at the master baseline: 176 pass / 6 fail in SIL.BuildTasks.Tests (the pre-existing locale failures in #91), 39/39 in SIL.ReleaseTasks.Tests, 0 build warnings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
[Unreleased] compared against v3.2.2, two releases behind the v3.3.0 tag. The [3.2.2] definition had neither a git tag nor a matching section, so its compare URL 404s; [3.3.0] had a section but no definition. Replaced the former with the latter. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
imnasnainaec
left a comment
There was a problem hiding this comment.
@imnasnainaec reviewed 5 files and all commit messages, and resolved 1 discussion.
Reviewable status: 0 of 5 files reviewed, all discussions resolved (waiting on tombogle).
tombogle
left a comment
There was a problem hiding this comment.
When you squash-merge, be sure to weed out the parts of the commit messages that refer to the intermediate states that will disappear when squashed.
@tombogle reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on imnasnainaec).
Microsoft.Build.Tasks.Core(all three packages) andSIL.Core(SIL.BuildTasks) are plainPackageReferences, so they land in each nuspec as public dependencies. MSBuild is supplied by the host, and these packages already ship the assemblies they need undertools/, so the only effect is pushing their transitive graphs onto consumers.Marking both
PrivateAssets="All"drops them from the nuspec. Thetools/payloads are unchanged.Measured
Restoring a throwaway project against the packed output, isolated package cache:
The net48 growth is
System.Text.Json,System.Resources.ExtensionsandSystem.Configuration.ConfigurationManager10.0.8 among others. On the SIL.BuildTasks side,Newtonsoft.Json11.0.1 (GHSA-5crp-9r3c-p9vr) drops out of the consumer graph, since it arrived viaSIL.Core— so this addresses the exposure the 3.3.0 changelog describes without reverting anything. TheSIL.Core17.0.0 upgrade reverted in #88 may be worth revisiting separately; the Mono.Unix restore breakage that forced it came through the same leak.History
ba0469f9removed theMicrosoft.Build.*references in 2022 as unnecessary;a1c127d1(#75) reintroduced this one as a package reference, and it first reached a published nuspec in 3.2.0.SIL.Corecame in via3608e3d5, forDateTimeProvider.Downstream
sillsdev/libpalaso#1543 currently pins SIL.ReleaseTasks to 3.1.1 on net462/net48 as a workaround, with a comment to revisit once a net462-compatible asset ships. Once this is released that pinning can go away. Worth noting the comment's diagnosis there doesn't match what actually resolves — net48 consumes the
net472asset normally, and net462 restores fine via a compile-onlyref/netstandard2.0; neither hits a missing-asset failure.Not included
Markdig.Signedstays a public dependency of all three packages, andMicrosoft.Win32.Registryof SIL.BuildTasks' netstandard2.0 target. Both already ship undertools/, so the same argument applies and the dependency set would end up empty — at which pointSuppressDependenciesWhenPackingwould say it once instead of per-reference. Happy to do either here.Testing
dotnet build SIL.BuildTasks.sln -c Releaseclean, 0 warningsdotnet testat the master baseline: 39/39 SIL.ReleaseTasks.Tests pass; SIL.BuildTasks.Tests 176 pass / 6 fail, identical on master. Those 6 are pre-existing and unrelated — filed as FileUpdate date insertion produces machine-dependent output (and 6 tests fail) when regional settings override the date separator #91SIL.BuildTasks.Testsneeded an explicitSIL.Core9.0.0 reference: it had been getting it transitively, and without itSIL.TestUtilities7.0.0'sSIL.Core7.0.0 wins and 24 tests fail withFileLoadExceptionfor the 9.0.0 assembly. Pinning it also clears the MSB3277 conflict warningtools/payloads still ship every DLL🤖 Generated with Claude Code
This change is